<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org"
      layout:decorator="backstage/layout">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>赛季管理</title>
</head>

<body>
<div id="content" layout:fragment="content">
<script type="text/javascript" src="../../../admin/js/bootstrap-paginator.js"></script>
<script type="text/javascript" src="../../../admin/ace/js/fuelux/fuelux.spinner.min.js"></script>
<script type="text/javascript" src="../../../admin/ace/js/ace-elements.min.js"></script>
<script type="text/javascript" src="../../../admin/js/competitionSeason.js"></script>
    <div class="box-content">
        <div class="row-fluid sortable">
            <div class="box span12">
                <h3 class="row-fluid header smaller lighter blue">
                   <span class="label label-large label-pink arrowed-right">赛季管理</span>
                </h3>
                <h3 class="row-fluid header smaller lighter blue">
                    <a href="#" class="btn btn-small btn-success btn-setting" data-toggle="modal" data-target="#myModal"><i class="icon-user"></i>新建赛季</a>
                </h3>
                
                <form action="/competitionSeason/list.htm" method="post" id="searchForm" style="margin-left:10px;">
		            <input type="hidden"  id="page" name="page" th:value="${page.page}" />
		            <input type="hidden"  name="totalPage" th:value="${page.totalPage}" />		            
		        </form>
        
                <div class="box-content">
                    <table class="table table-striped table-bordered bootstrap-datatable datatable">
                        <thead>
                        <tr >                           
                            <th style="text-align: center;">序号</th>
                            <th style="text-align: center;">杯赛名称</th>
                            <th style="text-align: center;">赛季</th>
                            <th style="text-align: center;">状态</th>
                            <th style="text-align: center;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="competitionSeason:${page.result}">
                        	<td th:text="${competitionSeason.id}" style="text-align: center;"></td>
                        	<td th:text="${competitionSeason.name}" style="text-align: center;"></td>
                            <td style="text-align: center;">
                            	<span th:text="${competitionSeason.startTime}"></span>
                            	<span th:if="${competitionSeason.startMonth}" th:text="${'/'+competitionSeason.startMonth}"></span>
                            	-
                            	<span th:text="${competitionSeason.endTime}"></span>
                            	<span th:if="${competitionSeason.endMonth}" th:text="${'/'+competitionSeason.endMonth}"></span>
                            	赛季
                            </td>
                            <td th:text="${competitionSeason.status==1?'显示':'不显示'}" style="text-align: center;"></td>
                            <td style="text-align: center;">
                                 <a class="edit-btn btn btn-small btn-danger" th:id="${competitionSeason.id}">
                                    		编辑赛季                             
                                </a> 
                                 <a class="competition-manage-btn btn btn-info btn-small" th:id="${competitionSeason.id}">                                  
                           					 赛程管理                                                                                                                     
                                </a>  
                                <a class="score-manage-btn btn btn-info btn-small" th:id="${competitionSeason.id}">                                  
                           					 比分管理                                                                                                                     
                                </a>
                                <!-- <a class="hide-btn btn btn-info btn-small" th:if="${competitionSeason.status == 1}" th:id="${competitionSeason.id}">                                  
                           					 前台不显示                                                                                                                    
                                </a> -->
                                <a class="show-btn btn btn-info btn-small" th:if="${competitionSeason.status == 2}" th:id="${competitionSeason.id}">                                  
                           					 前台显示                                                                                                                     
                                </a>        
                                
                                <input type="hidden" th:id="'name-'+${competitionSeason.id}" th:value="${competitionSeason.name}"/>
                                <input type="hidden" th:id="'startTime-'+${competitionSeason.id}" th:value="${competitionSeason.startTime}"/>  
                                <input type="hidden" th:id="'endTime-'+${competitionSeason.id}" th:value="${competitionSeason.endTime}"/> 
                                <input type="hidden" th:id="'startMonth-'+${competitionSeason.id}" th:value="${competitionSeason.startMonth}"/>  
                                <input type="hidden" th:id="'endMonth-'+${competitionSeason.id}" th:value="${competitionSeason.endMonth}"/>                                                   
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div style="margin-bottom: 0px; margin-left: auto;margin-right: auto">
		                <div id="example" style="margin-bottom:0px"></div>
		            </div>
                </div>
            </div>
        </div>
    </div>
    
    <div id="myModal" class="modal hide fade in">
        <div class="modal-header">
            <button class="close" data-dismiss="modal" type="button">×</button>
            <h3>新建赛季</h3>
        </div>
        <form class="form-horizontal" style="margin: 0" action="/competitionSeason/addOrUpdate.json" method="post" id="addSeason">
            <fieldset>
                <div class="modal-body">
                    <div class="control-group">
                        <label class="control-label">名称：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="name" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">赛季时间：</label>
                        <div class="controls">
                            <select name="startTime" id="add-startTime">
                            </select>
                            <select style="margin-top:10px;" name="endTime" id="add-endTime">
                            </select>
                        </div>
                    </div>
                    <div class="control-group add-month">
                        <label class="control-label">月份：</label>
                        <div class="controls">
                            <select name="startMonth" id="add-startMonth">
                            	<option value="1">1</option>
                            	<option value="2">2</option>
                            	<option value="3">3</option>
                            	<option value="4">4</option>
                            	<option value="5">5</option>
                            	<option value="6">6</option>
                            	<option value="7">7</option>
                            	<option value="8">8</option>
                            	<option value="9">9</option>
                            	<option value="10">10</option>
                            	<option value="11">11</option>
                            	<option value="12">12</option>
                            </select>
                            <select style="margin-top:10px;" name="endMonth" id="add-endMonth">
                            	<option value="1">1</option>
                            	<option value="2">2</option>
                            	<option value="3">3</option>
                            	<option value="4">4</option>
                            	<option value="5">5</option>
                            	<option value="6">6</option>
                            	<option value="7">7</option>
                            	<option value="8">8</option>
                            	<option value="9">9</option>
                            	<option value="10">10</option>
                            	<option value="11">11</option>
                            	<option value="12">12</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="submit" class="btn btn-primary" value="保存" />
                    <a href="#" class="btn btn-small" data-dismiss="modal">取消</a>
                </div>
            </fieldset>
        </form>
    </div>
    
    <div id="editModel" class="modal hide fade in" style="display: none;">
        <div class="modal-header">
            <button class="close" data-dismiss="modal" type="button">×</button>
            <h3>编辑赛季</h3>
        </div>
        <form class="form-horizontal" style="margin: 0" action="/competitionSeason/addOrUpdate.json" method="post" id="updateSeason">
             <input id="edit-id" name="id" type="hidden"/>
            <fieldset>
                <div class="modal-body">
                    <div class="control-group">
                        <label class="control-label">名称：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="name" id="edit-name"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">赛季时间：</label>
                        <div class="controls">
                            <select name="startTime" id="edit-startTime">
                            </select>
                            <select name="endTime" id="edit-endTime">
                            </select>
                        </div>
                    </div>
                    <div class="control-group edit-month">
                        <label class="control-label">月份：</label>
                        <div class="controls">
                            <select name="startMonth" id="edit-startMonth">
                            	<option value="1">1</option>
                            	<option value="2">2</option>
                            	<option value="3">3</option>
                            	<option value="4">4</option>
                            	<option value="5">5</option>
                            	<option value="6">6</option>
                            	<option value="7">7</option>
                            	<option value="8">8</option>
                            	<option value="9">9</option>
                            	<option value="10">10</option>
                            	<option value="11">11</option>
                            	<option value="12">12</option>
                            </select>
                            <select style="margin-top:10px;" name="endMonth" id="edit-endMonth">
                            	<option value="1">1</option>
                            	<option value="2">2</option>
                            	<option value="3">3</option>
                            	<option value="4">4</option>
                            	<option value="5">5</option>
                            	<option value="6">6</option>
                            	<option value="7">7</option>
                            	<option value="8">8</option>
                            	<option value="9">9</option>
                            	<option value="10">10</option>
                            	<option value="11">11</option>
                            	<option value="12">12</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="submit" class="btn btn-primary" value="保存" />
                    <a href="#" class="btn btn-small" data-dismiss="modal">取消</a>
                </div>
            </fieldset>
        </form>
    </div>
</div>
</body>
</html>
